# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnfs
pkgver=5.0.3
pkgrel=0
pkgdesc="Client library for accessing NFS shares"
url="https://github.com/sahlberg/libnfs"
arch="all"
options="!check"  # No test suite.
license="LGPL-2.1-or-later"
makedepends="autoconf automake m4 libtool"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
source="https://github.com/sahlberg/libnfs/archive/libnfs-$pkgver.tar.gz
	fix-includes.patch"

builddir="$srcdir"/libnfs-libnfs-$pkgver

prepare() {
	default_prepare
	./bootstrap
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/lib/*.a
}

tools() {
	pkgdesc="$pkgdesc (tools)"
	amove usr/bin
}

sha512sums="
1581c4a599e7b2a837553df2a4e1e4255a726907cd54ce3e82b0b725c79e2fd15d7ed921dbe9519d73204f5ca735d27b347888d3f1162c4c2144e9d72e327ff1  libnfs-5.0.3.tar.gz
99fb4a2d782201d151aede2018cd543496f67ef9bedccb9e6705add0b76f5d6942d3fa9852a05f4ed9956a6a341aaa85efe5b98dde858434dcefb357e72ef4a3  fix-includes.patch
"
